﻿// ===============================================================================
// DotNet.Platform 开发框架 2016 版权所有
// ===============================================================================
using System;
using DotNet.Core.Entity;
using DotNet.Core.Service;
using System.Web.Mvc;
using DotNet.Extensions;
using DotNet.JCore.Service;
using DotNet.Auth.Utility;

namespace DotNet.Web.Controllers
{
    public class BusRegDayRpt_ManualController : BaseController
    {
        private BusRegDayRpt_ManualService service = new BusRegDayRpt_ManualService();

        public ActionResult Index()
        {
            var currentUser = AuthHelper.GetSessionUser();
            if (currentUser.IsAdmin != true)
            {
               ViewBag.pointId = CurrentEmployee.PointId;
            }
            return View();
        }

        public ActionResult Grid(string startDate, string endDate, string PointID)
        {
            //先统计一下当日数据，将当日数据插入表中，再执行查询
            service.execproc_busreg("Proc_AutoGenRpt");
            var list = service.GetPageList(PageInfo(), startDate.ToDateTimeOrNull(), endDate.ToDateTimeOrNull(), PointID);
            return View(list);
        }

        public ActionResult Export(string startDate, string endDate, string PointID)
        {
            return Export(service.GetList(startDate.ToDateTimeOrNull(), endDate.ToDateTimeOrNull(), PointID));
        }

       
    }
}
